package com.hefei.garden.config.netty.server;

import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.springframework.stereotype.Component;

/**
 * @author: yxchen6
 * @date: 2022/7/24 14:52
 * @description:
 */
@Component
@Sharable
public class NettyServerLogHandler extends SimpleChannelInboundHandler<String> {

    @Override
    protected void channelRead0(ChannelHandlerContext context, String msg) {
        System.out.println(context.name());
        System.out.println(context.channel().remoteAddress());
    }

}
